<?php include "../../coresection/connection.php";?>
<?php include "../../coresection/checkSession.php";?>
<?php include "../../coresection/order-list.php";?>
<?php include "../../coresection/get_dishes_list.php";?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include '../../modules/head.php'; ?>
</head>

<body>
<?php include '../../modules/topbar.php'; ?>

<div class="setup_area">
    <?include '../../modules/sidebar-admin.php'?>

    <div class="header">
        <h1>菜式添加</h1>
        <?php include '../../modules/header.php'; ?>
    </div>


    <div class="content_area" style=" padding-bottom:350px; ">

<div class="admin_left_area">
<?include '../../model/slidebar.php'?>
</div>



        <style>
            .mulity-add-product { padding: 0; margin:15px 0 0 0px; list-style: none;overflow: hidden; padding-top: 5px;}
            .mulity-add-product li{ float: left; padding:15px; border:solid 1px #cccccc; margin-right: -1px; margin-top: -1px; height: 20px; }
            .layui-form-radio span{font-size: 0;}
        </style>



        <div class="tips" style="text-align: left">
            <div>1.请先选择时段</div>
            <div>2.先点击菜式名编辑框，再在底部选择菜式，即可自动填充菜式资料</div>
            <div>3.菜式设置完毕，多出的栏目留空即可</div>

            <input type="hidden" name="nownumber" id="nownumber" value=""/>
        </div>

<div class="main">

        <form action="../../coresection/admin-productadd-mulity-function.php" method="post" enctype="multipart/form-data">


            <div class="layui-form">
                <table class="layui-table">
                    <colgroup>
                        <col width="60">
                        <col width="120">
                        <col width="250">
                        <col width="80">
                        <col width="120">
                        <col width="120">
                        <col width="200">
                    </colgroup>
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>时段</th>
                        <th>菜式名</th>
                        <th>单价</th>
                        <th>月份</th>
                        <th>日期</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?
                    for($ii=0;$ii<15;$ii++){
                    ?>

                    <tr>
                        <td><? echo $ii+1 ?></td>
                        <td><select name="product_at_<? echo $ii ?>">
                                <option value="1">早餐</option>
                                <option value="2">午餐</option>
                                <option value="3">晚餐</option>
                            </select></td>

                        <td><input type="text" name="product_name_<? echo $ii ?>" id="product_name_<? echo $ii ?>" onclick="setnownumber(<? echo $ii ?>)" value="" class="layui-input"  />
                        </td>
                        <td><input type="text" name="product_price_<? echo $ii ?>" id="product_price_<? echo $ii ?>" onclick="setnownumber(<? echo $ii ?>)" value="" class="layui-input"/></td>

                        <td>

                            <select name="product_month_<? echo $ii ?>" class="product_week"  >

                                <option value="<? echo number_format(date(m)) ?>"> <? echo number_format(date(m)) ?>月</option>

                                <? for($i=1;$i<=12;$i++){?>
                                    <option value="<? echo $i ?>"> <? echo $i ?>月</option>
                                <? } ?>

                            </select>


                            </td>

                        <td>

    <select name="product_week_<? echo $ii ?>">
                                <? for($i=1;$i<=31;$i++){?>
                                    <option value="<? echo $i ?>"><? echo $i ?>号</option>
                                <? } ?>
                            </select></td>

                        <td>
                            <label for="fb_<? echo $ii ?>">发布</label><input type="radio" name="status<? echo $ii ?>" id="fb_<? echo $ii ?>"value="发布"  checked="checked"/>
                            <label for="dsh_<? echo $ii ?>">待审核</label><input type="radio" name="status<? echo $ii ?>" id="dsh_<? echo $ii ?>"value="待审核" />
                        </td>
                    </tr>
                        <?
                    }
                    ?>
                    </tbody>
                </table>
            </div>







            <div style="margin-top:20px; ">
                <input type="submit" class="layui-btn" value="确定""/>
            </div>











            <style>
                .dishes{ height: 300px; position: fixed; bottom: 0; background-color: #ffffff;  border-top:solid 3px #cccccc; padding-top:15px; margin: 0 }
                .dishes-list{ list-style: none; overflow: hidden; }
                .dishes .layui-tab-content{ list-style: none; overflow: hidden; margin-top: 25px; padding-top: 25px;overflow:scroll; height: 230px; padding: 0 0 15px 0}
                .dishes-list li{ text-align:left;float: left;min-width: 320px; margin-bottom: 10px;}
                .main label{ text-align: right; margin-right: 10px;}
                .admin_set_table  input{width: 300px!important;}
                .admin_set_table  select{width: 150px!important;}
            </style>





            <div class="layui-tab dishes">
                <ul class="layui-tab-title">
                    <li class="layui-this">早餐</li>
                    <li>午餐</li>
                    <li>晚餐</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <? include "dishes_list_zaocan.php" ?>
                    </div>
                    <div class="layui-tab-item">
                        <? include "dishes_list_wucan.php" ?>
                    </div>
                    <div class="layui-tab-item">
                        <? include "dishes_list_wancan.php" ?>
                    </div>
                </div>
            </div>







        </form>

    <script type="text/javascript">

        function setnownumber(number){
            document.getElementById("nownumber").value=number;
        }


        function setvalue(name,price){
            var nowii=document.getElementById("nownumber").value;
            if(!nowii){
                alert("请先选择要编辑的项目");
            }
            document.getElementById("product_name_"+nowii).value=name;
            document.getElementById("product_price_"+nowii).value=price;
        }
    </script>




</div>
</div>






    <?php include '../../modules/footer.php'; ?>
</body>
</html>
